package vip.dulaogou.park;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author  duyouwei
 * @create  2021/4/19 13:20
 * @description
 * 入库记录类
 * 当车子驶入时生成一个对应的入库记录，是一个辅助的中间类，方便出库时生成发票的
 **/
public class EnterRecord {
    private String carId;   /*车牌号*/
    private Integer parkLocation; /*停车位置，从0开始，最大值是车库的容量-1*/
    private Long startTime; /*开始时间*/

    public EnterRecord() {
    }

    public EnterRecord(String carId, Integer parkLocation, Long startTime) {
        this.carId = carId;
        this.parkLocation = parkLocation;
        this.startTime = startTime;
    }

    public String getCarId() {
        return carId;
    }

    public void setCarId(String carId) {
        this.carId = carId;
    }

    public Integer getParkLocation() {
        return parkLocation;
    }

    public void setParkLocation(Integer parkLocation) {
        this.parkLocation = parkLocation;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd:HH:mm:ss");
        return "EnterRecord{" +
                "carId='" + carId + '\'' +
                ", parkLocation=" + parkLocation +
                ", startTime=" + sdf.format(new Date(startTime)) +
                '}';
    }
}
